﻿using BikyBall.Game;
using BikyBall.Object;
using Microsoft.Xna.Framework;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace BikyBall.Physic
{
    public enum PhysicType
    {
        PHYSIC_NONE,
        PHYSIC_BALL,
        PHYSIC_BOX
    }

    public enum PhysicInteraction
    {
        None = 0,
        Gravity = 1,
        SolidMap = 2,
        SolidObject = 4,
        Input = 8,
        Movable = 16,
    }
    public class PhysicProperty : Property
    {
        public Vector3 Speed;
        public Vector3 Acceleration;
        public Vector3 Force;
        public PhysicInteraction PhysicInteraction = PhysicInteraction.None;
        public float Size = 1.0f;
        public float Weight = 1.0f;
        public PhysicType PhysicType = PhysicType.PHYSIC_BALL;
        private GameProperty _gameProperty;
        public Vector3 Position
        {
            get
            {
                return _gameProperty.Position;
            }
            set
            {
                _gameProperty.Position = value;
            }
        }

        public PhysicProperty() : base()
        {
            this.Dependencies.Add(typeof(GameProperty));
        }

        public override void PropInit(Property property)
        {
            this._gameProperty = (GameProperty)property;
        }
    }
}
